package com.penghaisoft.microwms.product.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.penghaisoft.microwms.common.dto.ConProCondDto;
import com.penghaisoft.microwms.common.dto.ProCountingDto;
import com.penghaisoft.microwms.common.dto.ProStorageDto;
import com.penghaisoft.microwms.common.mapper.BaseMapper;
import com.penghaisoft.microwms.common.page.Pager;
import com.penghaisoft.microwms.common.wms.model.MesConProRequired;
import com.penghaisoft.microwms.common.wms.model.ProStorageSn;

/**
 * @Description 成品库存明细表
 * @author luoteng
 * @date 2018年6月6日 下午2:43:41 
 * @version 1.0
 */
public interface ProStorageSnMapper  extends BaseMapper<ProStorageSn>{
	long queryStorageListCount(@Param("entity") ProStorageDto condition);
	long queryStorageListCountHZ(@Param("entity") ProStorageDto condition);
	
	List<ProStorageDto> queryStorageList(@Param("page") Pager<ProStorageDto> pager, @Param("entity") ProStorageDto rawStorageDto);
	List<ProStorageDto> queryStorageListHZ(@Param("page") Pager<ProStorageDto> pager, @Param("entity") ProStorageDto rawStorageDto);

	List<ProStorageSn> queryLose(@Param("entity") ProCountingDto proCountingDto);
	
	/** 
	 * @Title updateByBarcodeStatus0
	 * @Description 状态为0的条码完成出库更新[0：可用 1：冻结 2：已出库 3：抽检冻结]
	 * @author luoteng
	 * @date 2018年6月14日:下午4:29:48
	 * @param t
	 * @return Integer
	 */
	public Integer updateByBarcodeStatus0(@Param("entity") ProStorageSn t);
	
	/** 
	 * @Title updateByBarcodeStatus2
	 * @Description 状态为2的条码完成出库更新[0：可用 1：冻结 2：已出库 3：抽检冻结]
	 * @author luoteng
	 * @date 2018年6月14日:下午5:51:43
	 * @param t
	 * @return Integer
	 */
	public Integer updateByBarcodeStatus2(@Param("entity") ProStorageSn t);

	List<ProStorageSn> queryProStorageSnByCondition(@Param("entity") ProStorageSn proStorageSn);

	Integer updateOpenClose(@Param("entity") ProStorageSn proStorageSn);

	Integer updateWlByCode(ProStorageSn proStorageSn);
	
	public Integer updateContractNoBySelect(@Param("entity") ProStorageSn t);

	long queryCountChargeIn(@Param("entity") ProStorageSn proStorageSn);

	List<ProStorageSn> queryListChargeIn(@Param("page") Pager<ProStorageSn> pager,@Param("entity") ProStorageSn proStorageSn);

	long queryCountChargeOut(@Param("entity") ProStorageSn proStorageSn);

	List<ProStorageSn> queryListChargeOut(@Param("page") Pager<ProStorageSn> pager, @Param("entity") ProStorageSn proStorageSn);

	Integer updateBySelectIds(@Param("entity") ProStorageSn upOb);

	List<MesConProRequired> findConProRequired(@Param("entity") ConProCondDto conProCondDto);
	
	public ProStorageSn querySumAmountOut(@Param("entity") ProStorageSn t);
	
	public ProStorageSn querySumAmountIn(@Param("entity") ProStorageSn t);
	
	public ProStorageSn querySumAmount(@Param("entity") ProStorageSn t);
	
	public ProStorageDto querySumAmountOb(@Param("entity") ProStorageDto t);
	public ProStorageDto querySumAmountObHZ(@Param("entity") ProStorageDto t);
	
	long queryKulingCount(@Param("entity") ProStorageSn condition);

	List<ProStorageSn> queryKulingList(@Param("page") Pager<ProStorageSn> pager,@Param("entity") ProStorageSn condition);
	
	public List<ProStorageSn> queryModelList(@Param("page") Pager<ProStorageSn> page, @Param("entity") ProStorageSn t);
	
	public Long queryModelCount(@Param("entity") ProStorageSn t);
	
	List<ProStorageSn> findQuantitiyProduct(@Param("page") Pager<ProStorageSn> pager, @Param("entity") ProStorageSn condition);
	
	public Long countQuantitiyProduct(@Param("entity") ProStorageSn t);
	
	List<ProStorageSn> findQuantitiyProductToSn(@Param("page") Pager<ProStorageSn> pager, @Param("entity") ProStorageSn condition);
	
	public Long countQuantitiyProductToSn(@Param("entity") ProStorageSn t);
	
	public Long queryStorageChangeCount(@Param("entity") ProStorageSn t);

	public List<ProStorageSn> queryStorageChangeList(@Param("page") Pager<ProStorageSn> page, @Param("entity") ProStorageSn t);
	
	public List<ProStorageSn> findQuantitiyProductInTime(@Param("entity") ProStorageSn t);
}